import { minCache } from '@/utils/min-cache'

const sleep = (delay) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      try {
        resolve(1)
      } catch (e) {
        reject(0)
      }
    }, delay)
  })
}

export async function getMapInfo() {
  if (minCache.get('location')) {
    return minCache.get('location')
  } else {
    await sleep(50) // 等等看有没有回来
    return getMapInfo()
  }
}
